/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Generation.Production.impl;

import EA_Model.IEC61970.Core.impl.PowerSystemResourceImpl;

import EA_Model.IEC61970.Generation.Production.AirCompressor;
import EA_Model.IEC61970.Generation.Production.ProductionPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Air Compressor</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Generation.Production.impl.AirCompressorImpl#getAirCompressorRating <em>Air Compressor Rating</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class AirCompressorImpl extends PowerSystemResourceImpl implements AirCompressor {
	/**
	 * The cached value of the '{@link #getAirCompressorRating() <em>Air Compressor Rating</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAirCompressorRating()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float airCompressorRating;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected AirCompressorImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return ProductionPackage.Literals.AIR_COMPRESSOR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getAirCompressorRating() {
		if (airCompressorRating != null && airCompressorRating.eIsProxy()) {
			InternalEObject oldAirCompressorRating = (InternalEObject)airCompressorRating;
			airCompressorRating = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldAirCompressorRating);
			if (airCompressorRating != oldAirCompressorRating) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, ProductionPackage.AIR_COMPRESSOR__AIR_COMPRESSOR_RATING, oldAirCompressorRating, airCompressorRating));
			}
		}
		return airCompressorRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetAirCompressorRating() {
		return airCompressorRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAirCompressorRating(EA_Model.IEC61970.Domain.Float newAirCompressorRating) {
		EA_Model.IEC61970.Domain.Float oldAirCompressorRating = airCompressorRating;
		airCompressorRating = newAirCompressorRating;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, ProductionPackage.AIR_COMPRESSOR__AIR_COMPRESSOR_RATING, oldAirCompressorRating, airCompressorRating));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case ProductionPackage.AIR_COMPRESSOR__AIR_COMPRESSOR_RATING:
				if (resolve) return getAirCompressorRating();
				return basicGetAirCompressorRating();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case ProductionPackage.AIR_COMPRESSOR__AIR_COMPRESSOR_RATING:
				setAirCompressorRating((EA_Model.IEC61970.Domain.Float)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case ProductionPackage.AIR_COMPRESSOR__AIR_COMPRESSOR_RATING:
				setAirCompressorRating((EA_Model.IEC61970.Domain.Float)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case ProductionPackage.AIR_COMPRESSOR__AIR_COMPRESSOR_RATING:
				return airCompressorRating != null;
		}
		return super.eIsSet(featureID);
	}

} //AirCompressorImpl
